
#ifndef __GSL_EXT_MULTIDER_H__

#include <gsl/gsl_deriv.h>
#include <gsl/gsl_multimin.h>
#include <gsl/gsl_vector.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
  int n;
  gsl_vector *x_hi;
  gsl_vector *x_hj;
  gsl_vector *x_hihj;
  gsl_vector *f_hi;
}
gsl_ext_multider_evaluator_params;

/* functions for allocating and destroying 
 * finite-difference derivative evaluators */
gsl_ext_multider_evaluator_params *
gsl_ext_multider_evaluator_alloc(int n, void *params);

void 
gsl_ext_multider_evaluator_free(gsl_ext_multider_evaluator_params *e);

/* functions compatible with fdf and fd2f function 
 * pointers defined in GSL and gsl_ext */
void 
gsl_ext_multider_central_difference_df(const gsl_vector *x, void *params, gsl_vector *g);

void 
gsl_ext_multider_forward_difference_df(const gsl_vector *x, void *params, gsl_vector *g);

void 
gsl_ext_multider_forward_difference_fdf(const gsl_vector *x, void *params, double *f, gsl_vector *g);

void 
gsl_ext_multider_forward_difference_d2f(const gsl_vector *x, void *params, gsl_matrix *H);

void 
gsl_ext_multider_forward_difference_fd2f(const gsl_vector *x, void *params, double *f, gsl_vector *df, gsl_matrix *H);

#ifdef __cplusplus
}
#endif

#define __GSL_EXT_MULTIDER_H__

#endif
